import javax.swing.*;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Conversion extends JFrame implements ActionListener{
	
	private JFrame frame;
	private JButton buttonCelsius, buttonFahrenheit, buttonQuit;
	private JPanel panel;
	
	public Conversion()
	{
			frame = new JFrame("Celc/Fahr converter");
			frame.setSize(300, 400);
			frame.setLocation(200, 200);
			buttonFahrenheit = new JButton("Convert to Celsius");
			buttonCelsius = new JButton("Convert to Fahrenheit");
			buttonQuit = new JButton ("Quit");
			panel = new JPanel();
			//ajout du action Listener pour le bouton Cel
			buttonFahrenheit.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					new FahrenheitConverter();
				}
			});
			//ajout du action Listener pour le bouton Fah
			buttonCelsius.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					new CelsiusConverter();
				}
			});
			buttonQuit.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					System.exit(0);
				}
			});
			panel.setLayout(new FlowLayout());
			panel.add(buttonCelsius);
			panel.add(buttonFahrenheit);
			panel.add(buttonQuit);
			frame.getContentPane().add(panel, BorderLayout.CENTER);
			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			frame.pack();
			frame.setVisible(true);
		}
	
	
		public static void main(String[] args) {
			// Set the look and feel to Java Swing Look
			new Conversion();
		}


		@Override
		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			
		}
}
